<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
	<title>资源</title>
	<%@ include file="/common/meta.jsp" %>
    <%@ include file="/common/import.jsp" %>
	<%@ include file="uct-import.jsp" %>
	<script>

	var inputForm = '#inputForm';

	$(function(){
		$(inputForm).form({
		    onSubmit:function(){
		    	return $(this).form('validate');
		    },
		    success:function(data){
		    	var result = jQuery.parseJSON(data);
		    	if(result.flag=='T'){
		    		$.messager.alert('提交结果', result.msg, 'info',function(){
		    			parent.closeActAdd();
		    			if("0"=="${item.fatherId}"){
		    				parent.location.reload();
		    			}else{
		    				parent.reloadTree('${item.fatherId}','${item.actId}');
		    			}
		    		});
		    	}else{
		    		$.messager.alert('提交结果', result.msg, 'info');
		    	}        
		    }
		});
		
		if("${item.actId}"!=null&&"${item.actId}"!=""){
			$("#actEname").attr("readonly",true);
		}
		if("menu"=="${item.actType}" || ""=="${item.actType}"){
		   $('#actUrl').validatebox({required:false});
		   $('.isupdPass').hide();
		}
	}) ;
	
	function uPssOrN(flag){
		if(flag == 'Y'){
			$('#actUrl').validatebox({required:true});
			$('.isupdPass').show();
		}else if(flag == 'N'){
			$('#actUrl').validatebox({required:false});
			$('.isupdPass').hide();
		}
	}


</script>
</head>
<body>	

<div id="tip"></div>
	<form id="inputForm" name="inputForm" method="post" action="${ctx }/uct/act/save.action">
		<input type="hidden" name="formToken" id="formToken" value="${formToken}">
		<input type="hidden" name="actId" id="actId" value="${item.actId}"/>
		<input type="hidden" name="fatherId" id="fatherId" value="${item.fatherId}"/>
		<table class="datagrid-body" >
			<tr >
				<td class="datagrid-header">资源名称<span style="color:red;" >*</span></td>
				<td>
				<input name="actCname"  id="actCname" value="${item.actCname}"
				class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" size="30" 
				missingMessage="请输入名称" invalidMessage="应为2~30个字" />				
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">资源标识<span style="color:red;" >*</span></td>
				<td>
				<input id="actEname" name="actEname"  value="${item.actEname}"
				class="easyui-validatebox" data-options="required:true" size="30"  
				missingMessage="请输入资源标识" />
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">资源类型<span style="color:red;" >*</span></td>				
				<td>
				<input type="radio" name="actType" id="actType_menu" value="menu" onclick="uPssOrN('N')" />菜单
				<input type="radio" name="actType"  id="actType_action" value="action" onclick="uPssOrN('Y')"/>action
				</td>
			</tr>
			<tr>
			<tr class="isupdPass">
				<td class="datagrid-header">资源地址<span style="color:red;" >*</span></td>
				<td>
				<input id="actUrl" name="actUrl" data-options="required:true" value="${item.actUrl}" size="30" />
				</td>
			</tr>
			
			<tr>
				<td class="datagrid-header">状态<span style="color:red;" >*</span></td>
				<td>
				<input type="radio" name="actStatus" id="actStatus_1" value="1" />启用
				<input type="radio" name="actStatus"  id="actStatus_0" value="0" />停用
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">排序值</td>
				<td>
				<input id="orderNum" name="orderNum"  value="${item.orderNum}"
				class="easyui-numberbox"  />
				</td>
			</tr>	

			
							
				<tr>
				<td class="datagrid-header"></td>
				<td >	
				<input type="submit" value="提交"/>	
				<!--  	
				<a href="#" class="easyui-linkbutton" iconCls="icon-save"
					onClick="$('#orgSaveForm').form('submit');">保存</a>	
					-->				
				</td>
			</tr>
			
		</table>
		
	</form>
</body>
</html>


<script>
initRadio("actType","${item.actType}");
initRadio("actStatus","${item.actStatus}");
</script>